Skip to content

feature: QrCode component#4394

Open
Hugos68 wants to merge 14 commits intomainfrom
feature/qr-code
Open

feature: QrCode component#4394
Hugos68 wants to merge 14 commits intomainfrom
feature/qr-code

Conversation

@Hugos68
Copy link
Copy Markdown
Contributor

@Hugos68 Hugos68 commented Apr 27, 2026

Linked Issue

Closes #{issueNumber}

Description

Adds:

  • QrCode component
  • QrCode tests
  • QrCode playground

AI Disclosure

Use of LLM technology is allowed. We ask for your voluntary disclosure to help inform future Skeleton contribution guidelines.

  • I used AI to generate this pull request

Checklist

Please read and apply all contribution requirements.

  • Your branch should be prefixed with: docs/, feature/, task/, bugfix/
  • Contributions should target the main branch
  • Documentation should be updated to describe all relevant changes
  • Run pnpm check in the root of the monorepo
  • Run pnpm format in the root of the monorepo
  • Run pnpm lint in the root of the monorepo
  • Run pnpm test in the root of the monorepo
  • If you modify /package projects, please supply a Changeset

Changesets

View our documentation to learn more about Changesets. To create a Changeset:

  1. Navigate to the root of the monorepo in your terminal
  2. Run pnpm changeset and follow the prompts
  3. Commit and push the changeset before flagging your PR ready for review.

Hugos68 and others added 7 commits April 26, 2026 17:38
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 27, 2026

⚠️ No Changeset found

Latest commit: 0192508

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
themes.skeleton.dev Ready Ready Preview May 8, 2026 3:34pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
plus.skeleton.dev Ignored Ignored Preview May 8, 2026 3:34pm
www.skeleton.dev Ignored Ignored Preview May 8, 2026 3:34pm

Request Review

Copy link
Copy Markdown
Contributor

@endigo9740 endigo9740 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Hugos68 Overall everything looks great. Just a few suggestions here. Let me know if you have any questions or feedback. Thanks bud!

Comment thread packages/skeleton-svelte/src/components/qr-code/anatomy/root.svelte
display: grid;
gap: --spacing(2);
}
&[data-part='frame'] {
Copy link
Copy Markdown
Contributor

@endigo9740 endigo9740 Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to include an explicit example of modifying the color of the frame/pattern parts, as they require different and specific properties.

Maybe brand color for the frame, brand contrast for the pattern.

<QrCode.Frame>
<QrCode.Pattern />
</QrCode.Frame>
<QrCode.Overlay>Overlay</QrCode.Overlay>
Copy link
Copy Markdown
Contributor

@endigo9740 endigo9740 Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow Zag's lead on demoing the overlay feature, just use a Lucide icon + square background styling to help separate from the busy pattern. All in user-land of course.

Screenshot 2026-04-30 at 11 02 04 AM

Don't follow their lead on the poor choice of color contrast though :D

color: var(--color-surface-100-900);
}
&[data-part='download-trigger'] {
@apply btn preset-filled;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was meaning to talk to you about the use of presets in our components. While I think btn is fine for adding form, I think presets may have gotchas. The reason being is preset classes don't "swap" like the used to, they override.

If you were to apply apply class="preset-outlined-primary-500" on this button as a user, you would expect a transparent background with a border edge of the colors defined. But what you get instead is a filled button with an outline added.

One of two things needs to happen:

  1. We need to prune presets from the stylesheet and keep those in user-land only. A breaking change, but my recommendation.
  2. We need to add an implicit bg-transparent on the outline presets.

I'd have real concern for number 2 as it may unintentionally break this pattern:

preset-tonal preset-outlined-surface-200-800

This would result in a tonal fill but outlined edge. Aka what we used to call "ghost" styling in v2. But if we add an explicit transparent bg, it may render this unviable.

<QrCode.Pattern />
</QrCode.Frame>
<QrCode.Overlay>Overlay</QrCode.Overlay>
<QrCode.DownloadTrigger mimeType="image/png" fileName="skeleton-qr-code">Download</QrCode.DownloadTrigger>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a consideration for another example - folks might request a version where you can click on the QR code to download it. Maybe try a variation with the frame/pattern wrapped by this button?

- Namespace composition uses `Object.assign(Root, { ...parts })` in `modules/anatomy.ts`.
- For static parts, include `data-scope` and `data-part` attributes.

## Prompt flow
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks awesome. Only bit of feedback is perhaps prompt users for a Zag documentation URL. Then notify the LLM here how to convert to the machine-friendly version:

You might even try and include the Github source for the component using a similar pattern, so it can have a deep level of understanding of how this operates.

Just to make this an explicit part of the user<->llm transaction upfront.


1. **Component name** — kebab-case folder and PascalCase namespace. Recommend both, accept overrides.
2. **Type** — static/simple or machine-backed (Zag). This resolves required module files.
3. **Parts list** — root-only or full anatomy list (`root`, `trigger`, `content`, etc.).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Step 3 and 4 feels like something the LLM could likely suggest for us if provided the documentation mentioned above. Just accept user overrides.

- Svelte suite: `packages/skeleton-svelte/test/components/<component>.test.ts`

4. For each anatomy part, include a render assertion (`toBeInTheDocument`).
5. If the component should be previewable in the playgrounds, add matching demo entries in both frameworks and regenerate the React route manifest if a new route was added.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing prompts the user if playground should be created, so might be worth being a default on, user opt-out?


Ask one at a time, confirm each answer, write nothing until all are answered and the user confirms.

1. **Component slug** - kebab-case route segment (for example `floating-panel`).
Copy link
Copy Markdown
Contributor

@endigo9740 endigo9740 Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When folks are using LLMs they're going to likely use natural language and write "Floating Panel" or "floating panel" or " I want to add a floating panel component". So allow any input, but let the LLM coerce to specific kabab format here. Again user confirmation is good.

Same deal for the other skill btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants